<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
<%@page import="java.util.*"%>
<%@page import="java.util.HashMap"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title>Insert title here</title>
</head>
<body>
<%

Map<String,String[]> m1 = request.getParameterMap();
Set<String> set = m1.keySet();//返回此映射中包含的 键 的 Set视图。
for(String str:set) {
	out.println(str+":");
	String[] value = m1.get(str);//返回指定键所映射的值
	for(String str2:value)
      out.println(str2);
}



/* 返回此映射中包含的所有值的 Collection 视图。输出name: www name: apple pear favoriate: www favoriate: apple pear。 所以还是不要用它了吧
Map<String,String[]> m1 = request.getParameterMap();
Set<String> set = m1.keySet();//返回此映射中包含的 键 的 Set视图。
for(String s:set) {
	out.println(s);
	Collection<String[]> c = m1.values();//返回此映射中包含的值的 Collection 视图。
	for(String[] o:c) {
		for(int i=0;i<o.length;i++) {
			out.println(o[i]);
		}
	}
}

*/

%>
 
 
 
<%--
Map<String,String[]> m1=request.getParameterMap();
Set<Map.Entry<String,String[]>> set= m1.entrySet();//返回此映射中包含的映射关系的 Set 视图
Iterator<Map.Entry<String, String[]>> it = set.iterator();  
while (it.hasNext()) {  
    Map.Entry<String, String[]> en = it.next();  

    out.println(en.getKey()+":");  
    for (String i : en.getValue()) {  
         out.println(i);  
    }  
}
--%>
</body>
</html>